#pragma once

//////////////////////////////////////////////////////////////////////////
//
// Structure to keep useful information about Direct3D together
//
//////////////////////////////////////////////////////////////////////////

#include <cstdint>
#include <d3d11.h>

struct ID3D11Device;
struct ID3D11DeviceContext;
struct IDXGISwapChain;
struct ID3D11Texture2D;
struct ID3D11RenderTargetView;
struct ID3D11DepthStencilView;
struct D3D11_VIEWPORT;
struct WindowData;

struct Direct3DData { 
    ID3D11Device* mDevice;
    ID3D11DeviceContext* mImmediateContext;
    IDXGISwapChain* mSwapChain;
    ID3D11Texture2D* mDepthStencilBuffer;
    ID3D11RenderTargetView* mRenderTargetView;
    ID3D11DepthStencilView* mDepthStencilView;
    D3D11_VIEWPORT* mViewport;

	Direct3DData(WindowData& windowData);
	~Direct3DData();

private:
	void createDeviceAndImmediateContext();

	void createSwapChain(const HWND windowHandler, const DXGI_FORMAT displayFormat, const uint32_t msaaQuality, const uint32_t sampleCount);

	void createRenderTargetView();

	void createDepthStencilBufferAndView(const uint32_t msaaQuality, const uint32_t sampleCount);

	void initViewport();

	void initCamera();
};

